package com.cmj.controller;

import com.cmj.entity.Result;
import com.cmj.entity.Users;
import com.cmj.service.UsersService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(value = "UserController", description = "用户管理相关API")
public class UsersController {

    @Autowired
    UsersService usersService;

    @ApiOperation(value = "说哈喽",notes = "sdfasdf你好")
    @RequestMapping("hello")
    public void hello(){

    }

    /**
     * 查询全部
     * @return
     */
    @RequestMapping(value = "/selectAll",method = RequestMethod.GET)
    public Result selectAll(){
        List<Users> list = usersService.selectAll();
        return new Result(list,true);
    }

}
